<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>可以从外部关闭的下拉菜单</title>
	<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
	
	<div id="app" v-cloak>
		<div class="main" v-clickoutside="handleClose" v-clickoutside.esc="handleCloseEsc">
			<button @click="show = !show">点击显示下拉菜单</button>
			<div class="dropdown" v-show="show">
				<p>下拉框的内容，点击外面区域可以关闭</p>
			</div>
		</div>
	</div>
	<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
	<script src="clickoutside.js"></script>
	<script src="index.js"></script>
</body>
</html>
